<template>
	<view>
		<view class="top-money-box">
			<view class="user-money-box">
				<view class="money-name">今日收入 （元）</view>
				<view class="user-money">{{ moneyDetail.today_money }}</view>
			</view>
			<view class="user-count-box">
				<view class="label-count border-right">
					<view class="label-name">本月收入</view>
					<view class="label-money">{{ moneyDetail.month_money }}</view>
				</view>
				<view class="label-count">
					<view class="label-name">累计收入</view>
					<view class="label-money">{{ moneyDetail.sum_money }}</view>
				</view>
			</view>
		</view>
		
		<view class="btm-money-box">
			<view>
				
				<!-- 待确认收入 -->
				<!-- <view class="label-item-money">
					<view class="top-label-item">
						<view class="top-label-item-name">待确认收入</view>
					</view>
					<view class="btm-label-item-money">39.60</view>
				</view> -->
				
				<!-- 可提金额 -->
				<view class="label-item-money">
					<view class="top-label-item">
						<view class="top-label-item-name">可提现金额</view>
					</view>
					<view class="btm-label-item-money">{{ moneyDetail.money }}</view>
				</view>
				
				<!-- 已打款金额 -->
				<view class="label-item-money">
					<view class="top-label-item">
						<view class="top-label-item-name">已打款金额</view>
						<view class="top-label-item-desc" @click="goToRecold('/pages/page/shopadmin/wallet/applyRecold')">提现记录</view>
					</view>
					<view class="btm-label-item-money">{{ moneyDetail.tixian }}</view>
				</view>
			</view>
			
			<view class="submit-btn" @click="goToApply">提现</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				moneyDetail: {}
			}
		},
		onShow() {
			this.init()
		},
		methods: {
			//初始化钱包
			init() {
				let to_shop_id = uni.getStorageSync('userShopId');
				this.$api.post({
					url: '/wanlshop.shop/shopBag',
					data: { to_shop_id },
					success: res => {
						this.moneyDetail = res
					}
				})
			},
			
			goToRecold(path) {
				uni.navigateTo({
					url: path
				})
			},
			
			// 去提现
			goToApply() {
				uni.navigateTo({
					url: "/pages/page/shopadmin/wallet/apply?money="+this.moneyDetail.money
				})
			}
		}
	}
</script>

<style scoped>
.top-money-box {
	width: 100%;
	display: flex;
	flex-direction: column;
	background: #fd8465;
}
.user-money-box {
	display: flex;
	align-items: center;
	flex-direction: column;
	margin-top: 60rpx;
	margin-bottom: 50rpx;
}
.money-name {
	font-size: 32rpx;
	color: white;
	font-weight: 500;
	margin-bottom: 45rpx;
}
.user-money {
	font-size: 50rpx;
	font-weight: bold;
	color: white;
}
.user-count-box {
	width: 100%;
	display: flex;
	padding-bottom: 20rpx;
}
.label-count {
	flex-shrink: 0;
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 10rpx 0 15rpx 0;
}
.label-name {
	font-size: 32rpx;
	color: white;
	font-weight: 500;
	line-height: 32rpx;
	margin-bottom: 20rpx;
}
.label-money {
	font-size: 28rpx;
	font-weight: bold;
	color: white;
	line-height: 28rpx;
}
.border-right {
	border-right: solid 1rpx white;
}
.btm-money-box {
	padding: 35rpx 30rpx;
}
.label-item-money {
	display: flex;
	flex-direction: column;
	margin-bottom: 30rpx;
	
}
.top-label-item {
	display: flex;
	align-items: center;
	margin-bottom: 30rpx;
}
.top-label-item-name {
	font-size: 30rpx;
	color: #9f9f9f;
	margin-right: 30rpx;
	line-height: 30rpx;
}
.top-label-item-desc {
	font-size: 32rpx;
	font-weight: 500;
	line-height: 32rpx;
	font-weight: 500;
}
.btm-label-item-money {
	font-size: 36rpx;
	line-height: 36rpx;
	font-weight: 500;
}
.submit-btn {
	width: 100%;
	height: 70rpx;
	border-radius: 15rpx;
	background-color: #fc8466;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 32rpx;
	color: white;
	font-weight: bold;
	letter-spacing: 10rpx;
	margin-top: 80rpx;
}
</style>
